package com.ljy.usercenter.model;

import cn.hutool.core.lang.Snowflake;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;

import java.io.Serializable;
import java.time.OffsetDateTime;
import java.util.Date;

/**
 * 用户
 * @TableName user
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * 主键id

     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 用户账户
     */
    @TableField(value = "user_account")
    private String userAccount;

    /**
     * 头像地址
     */
    @TableField(value = "avatar_url")
    private String avatarUrl;

    /**
     * 性别 1:男 0:女
     */
    @TableField(value = "gender")
    private int gender;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 电话
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 是否有效 1:有效 0:无效
     */
    @TableField(value = "user_status")
    private int userStatus;

    /**
     * 角色 0:普通用户 1:管理员
     */
    @TableField(value = "role")
    private int role;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private OffsetDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private OffsetDateTime updateTime;

    /**
     * 星球编号
     */
    @TableField(value = "planet_code")
    private String planetCode;

    /**
     * 否删除 0:已删除 1:未删除(逻辑删除)
     */
    @TableField(value = "is_delete")
    @TableLogic(value = "0", delval = "1")
    private int isDelete = 0;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}